<template>
  <h1>姓名：{{ name }}</h1>
  <h1>年龄：{{ age }}</h1>
  <button @click="sayHi">说话</button>
</template>

<script>
export default {
  name: "App",
  setup() {
    let name = "lwt";
    let age = 18;
    function sayHi() {
      alert(`我的名字是${name},今年${age}岁了`);
    }

    return {
      name,
      age,
      sayHi,
    };
  },
};
</script>

<style>
</style>
